home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / SpeechRecognition.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  21.4 KB  |  509 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        SpeechRecognition.h
  3.  
  4.      Contains:    Apple Speech Recognition Toolbox Interfaces.
  5.  
  6.      Version:    Technology:    PlainTalk 1.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1992-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __SPEECHRECOGNITION__
  19. #define __SPEECHRECOGNITION__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __MIXEDMODE__
  25. #include <MixedMode.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50. /* Error Codes [Speech recognition gets -5100 through -5199] */
  51.  
  52. enum {
  53.     kSRNotAvailable                = -5100,                        /* the service requested is not avail or applicable */
  54.     kSRInternalError            = -5101,                        /* a system internal or hardware error condition */
  55.     kSRComponentNotFound        = -5102,                        /* a needed system resource was not located */
  56.     kSROutOfMemory                = -5103,                        /* an out of memory error occurred in the toolbox memory space */
  57.     kSRNotASpeechObject            = -5104,                        /* the object specified is no longer or never was valid */
  58.     kSRBadParameter                = -5105,                        /* an invalid parameter was specified */
  59.     kSRParamOutOfRange            = -5106,                        /* when we say 0-100, don't pass in 101. */
  60.     kSRBadSelector                = -5107,                        /* an unrecognized selector was specified */
  61.     kSRBufferTooSmall            = -5108,                        /* returned from attribute access functions */
  62.     kSRNotARecSystem            = -5109,                        /* the object used was not a SRRecognitionSystem */
  63.     kSRFeedbackNotAvail            = -5110,                        /* there is no feedback window associated with SRRecognizer */
  64.     kSRCantSetProperty            = -5111,                        /* a non-settable property was specified */
  65.     kSRCantGetProperty            = -5112,                        /* a non-gettable property was specified */
  66.     kSRCantSetDuringRecognition    = -5113,                        /* the property can't be set while recognition is in progress -- do before or between utterances. */
  67.     kSRAlreadyListening            = -5114,                        /* in response to SRStartListening */
  68.     kSRNotListeningState        = -5115,                        /* in response to SRStopListening */
  69.     kSRModelMismatch            = -5116,                        /* no acoustical models are avail to match request */
  70.     kSRNoClientLanguageModel    = -5117,                        /* trying to access a non-specified SRLanguageModel */
  71.     kSRNoPendingUtterances        = -5118,                        /* nothing to continue search on */
  72.     kSRRecognitionCanceled        = -5119,                        /* an abort error occurred during search */
  73.     kSRRecognitionDone            = -5120,                        /* search has finished, but nothing was recognized */
  74.     kSROtherRecAlreadyModal        = -5121,                        /* another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now */
  75.     kSRHasNoSubItems            = -5122,                        /* SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. */
  76.     kSRSubItemNotFound            = -5123,                        /* returned when accessing a non-existent sub item of a container */
  77.     kSRLanguageModelTooBig        = -5124,                        /* Cant build language models so big */
  78.     kSRAlreadyReleased            = -5125,                        /* this object has already been released before */
  79.     kSRAlreadyFinished            = -5126,                        /* the language model can't be finished twice */
  80.     kSRWordNotFound                = -5127,                        /* the spelling couldn't be found in lookup(s) */
  81.     kSRNotFinishedWithRejection    = -5128,                        /* property not found because the LMObj is not finished with rejection */
  82.     kSRExpansionTooDeep            = -5129,                        /* Language model is left recursive or is embedded too many levels */
  83.     kSRTooManyElements            = -5130,                        /* Too many elements added to phrase or path or other langauge model object */
  84.     kSRCantAdd                    = -5131,                        /* Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject)    */
  85.     kSRSndInSourceDisconnected    = -5132,                        /* Sound input source is disconnected */
  86.     kSRCantReadLanguageObject    = -5133,                        /* An error while trying to create new Language object from file or pointer -- possibly bad format */
  87.                                                                 /* non-release debugging error codes are included here */
  88.     kSRNotImplementedYet        = -5199                            /* you'd better wait for this feature in a future release */
  89. };
  90.  
  91.  
  92. /* Type Definitions */
  93. typedef struct OpaqueSRSpeechObject*     SRSpeechObject;
  94. typedef SRSpeechObject                     SRRecognitionSystem;
  95. typedef SRSpeechObject                     SRRecognizer;
  96. typedef SRSpeechObject                     SRSpeechSource;
  97. typedef SRSpeechSource                     SRRecognitionResult;
  98. typedef SRSpeechObject                     SRLanguageObject;
  99. typedef SRLanguageObject                 SRLanguageModel;
  100. typedef SRLanguageObject                 SRPath;
  101. typedef SRLanguageObject                 SRPhrase;
  102. typedef SRLanguageObject                 SRWord;
  103. /* between 0 and 100 */
  104. typedef unsigned short                     SRSpeedSetting;
  105. /* between 0 and 100 */
  106. typedef unsigned short                     SRRejectionLevel;
  107. /* When an event occurs, the user supplied proc will be called with a pointer    */
  108. /*    to the param passed in and a flag to indicate conditions such                */
  109. /*    as interrupt time or system background time.                                */
  110. struct SRCallBackStruct {
  111.     long                             what;                        /* one of notification flags */
  112.     long                             message;                    /* contains SRRecognitionResult id */
  113.     SRRecognizer                     instance;                    /* ID of recognizer being notified */
  114.     OSErr                             status;                        /* result status of last search */
  115.     short                             flags;                        /* non-zero if occurs during interrupt */
  116.     long                             refCon;                        /* user defined - set from SRCallBackParam */
  117. };
  118. typedef struct SRCallBackStruct SRCallBackStruct;
  119.  
  120. /* Call back procedure definition */
  121. typedef CALLBACK_API( void , SRCallBackProcPtr )(SRCallBackStruct *param);
  122. typedef STACK_UPP_TYPE(SRCallBackProcPtr)                         SRCallBackUPP;
  123. enum { uppSRCallBackProcInfo = 0x000000C0 };                     /* pascal no_return_value Func(4_bytes) */
  124. #define NewSRCallBackProc(userRoutine)                             (SRCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSRCallBackProcInfo, GetCurrentArchitecture())
  125. #define CallSRCallBackProc(userRoutine, param)                     CALL_ONE_PARAMETER_UPP((userRoutine), uppSRCallBackProcInfo, (param))
  126. struct SRCallBackParam {
  127.     SRCallBackUPP                     callBack;
  128.     long                             refCon;
  129. };
  130. typedef struct SRCallBackParam SRCallBackParam;
  131.  
  132. /* Recognition System Types */
  133.  
  134. enum {
  135.     kSRDefaultRecognitionSystemID = 0
  136. };
  137.  
  138. /* Recognition System Properties */
  139.  
  140. enum {
  141.     kSRFeedbackAndListeningModes = FOUR_CHAR_CODE('fbwn'),        /* short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes */
  142.     kSRRejectedWord                = FOUR_CHAR_CODE('rejq'),        /* the SRWord used to represent a rejection */
  143.     kSRCleanupOnClientExit        = FOUR_CHAR_CODE('clup')        /* Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits */
  144. };
  145.  
  146.  
  147. enum {
  148.     kSRNoFeedbackNoListenModes    = 0,                            /* next allocated recognizer has no feedback window and doesn't use listening modes    */
  149.     kSRHasFeedbackHasListenModes = 1,                            /* next allocated recognizer has feedback window and uses listening modes             */
  150.     kSRNoFeedbackHasListenModes    = 2                                /* next allocated recognizer has no feedback window but does use listening modes     */
  151. };
  152.  
  153. /* Speech Source Types */
  154.  
  155. enum {
  156.     kSRDefaultSpeechSource        = 0,
  157.     kSRLiveDesktopSpeechSource    = FOUR_CHAR_CODE('dklv'),        /* live desktop sound input */
  158.     kSRCanned22kHzSpeechSource    = FOUR_CHAR_CODE('ca22')        /* AIFF file based 16 bit, 22.050 KHz sound input */
  159. };
  160.  
  161. /* Notification via Apple Event or Callback */
  162. /* Notification Flags */
  163.  
  164. enum {
  165.     kSRNotifyRecognitionBeginning = 1L << 0,                    /* recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition */
  166.     kSRNotifyRecognitionDone    = 1L << 1                        /* recognition has terminated. result (if any) is available. */
  167. };
  168.  
  169. /* Apple Event selectors */
  170. /* AppleEvent message class  */
  171.  
  172. enum {
  173.     kAESpeechSuite                = FOUR_CHAR_CODE('sprc')
  174. };
  175.  
  176. /* AppleEvent message event ids */
  177.  
  178. enum {
  179.     kAESpeechDone                = FOUR_CHAR_CODE('srsd'),
  180.     kAESpeechDetected            = FOUR_CHAR_CODE('srbd')
  181. };
  182.  
  183. /* AppleEvent Parameter ids */
  184.  
  185. enum {
  186.     keySRRecognizer                = FOUR_CHAR_CODE('krec'),
  187.     keySRSpeechResult            = FOUR_CHAR_CODE('kspr'),
  188.     keySRSpeechStatus            = FOUR_CHAR_CODE('ksst')
  189. };
  190.  
  191. /* AppleEvent Parameter types */
  192.  
  193. enum {
  194.     typeSRRecognizer            = FOUR_CHAR_CODE('trec'),
  195.     typeSRSpeechResult            = FOUR_CHAR_CODE('tspr')
  196. };
  197.  
  198.  
  199. /* SRRecognizer Properties */
  200.  
  201. enum {
  202.     kSRNotificationParam        = FOUR_CHAR_CODE('noti'),        /* see notification flags below */
  203.     kSRCallBackParam            = FOUR_CHAR_CODE('call'),        /* type SRCallBackParam */
  204.     kSRSearchStatusParam        = FOUR_CHAR_CODE('stat'),        /* see status flags below */
  205.     kSRAutoFinishingParam        = FOUR_CHAR_CODE('afin'),        /* automatic finishing applied on LM for search */
  206.     kSRForegroundOnly            = FOUR_CHAR_CODE('fgon'),        /* Boolean. Default is true. If true, client recognizer only active when in foreground.    */
  207.     kSRBlockBackground            = FOUR_CHAR_CODE('blbg'),        /* Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    */
  208.     kSRBlockModally                = FOUR_CHAR_CODE('blmd'),        /* Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! */
  209.     kSRWantsResultTextDrawn        = FOUR_CHAR_CODE('txfb'),        /* Boolean. Default is true. If true, search results are posted to Feedback window */
  210.     kSRWantsAutoFBGestures        = FOUR_CHAR_CODE('dfbr'),        /* Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior */
  211.     kSRSoundInVolume            = FOUR_CHAR_CODE('volu'),        /* short in [0..100] log scaled sound input power. Can't set this property */
  212.     kSRReadAudioFSSpec            = FOUR_CHAR_CODE('aurd'),        /* *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF */
  213.     kSRCancelOnSoundOut            = FOUR_CHAR_CODE('caso'),        /* Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. */
  214.     kSRSpeedVsAccuracyParam        = FOUR_CHAR_CODE('sped')        /* SRSpeedSetting between 0 and 100 */
  215. };
  216.  
  217. /* 0 means more accurate but slower. */
  218. /* 100 means (much) less accurate but faster. */
  219.  
  220. enum {
  221.     kSRUseToggleListen            = 0,                            /* listen key modes */
  222.     kSRUsePushToTalk            = 1
  223. };
  224.  
  225.  
  226. enum {
  227.     kSRListenKeyMode            = FOUR_CHAR_CODE('lkmd'),        /* short: either kSRUseToggleListen or kSRUsePushToTalk */
  228.     kSRListenKeyCombo            = FOUR_CHAR_CODE('lkey'),        /* short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message */
  229.     kSRListenKeyName            = FOUR_CHAR_CODE('lnam'),        /* Str63: string representing ListenKeyCombo */
  230.     kSRKeyWord                    = FOUR_CHAR_CODE('kwrd'),        /* Str255: keyword preceding spoken commands in kSRUseToggleListen mode */
  231.     kSRKeyExpected                = FOUR_CHAR_CODE('kexp')        /* Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? */
  232. };
  233.  
  234. /* Operational Status Flags */
  235.  
  236. enum {
  237.     kSRIdleRecognizer            = 1L << 0,                        /* engine is not active */
  238.     kSRSearchInProgress            = 1L << 1,                        /* search is in progress */
  239.     kSRSearchWaitForAllClients    = 1L << 2,                        /* search is suspended waiting on all clients' input */
  240.     kSRMustCancelSearch            = 1L << 3,                        /* something has occurred (sound played, non-speech detected) requiring the search to abort */
  241.     kSRPendingSearch            = 1L << 4                        /* we're about to start searching */
  242. };
  243.  
  244. /* Recognition Result Properties */
  245.  
  246. enum {
  247.     kSRTEXTFormat                = FOUR_CHAR_CODE('TEXT'),        /* raw text in user supplied memory */
  248.     kSRPhraseFormat                = FOUR_CHAR_CODE('lmph'),        /* SRPhrase containing result words */
  249.     kSRPathFormat                = FOUR_CHAR_CODE('lmpt'),        /* SRPath containing result phrases or words */
  250.     kSRLanguageModelFormat        = FOUR_CHAR_CODE('lmfm')        /* top level SRLanguageModel for post parse */
  251. };
  252.  
  253. /* SRLanguageObject Family Properties */
  254.  
  255. enum {
  256.     kSRSpelling                    = FOUR_CHAR_CODE('spel'),        /* spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel */
  257.     kSRLMObjType                = FOUR_CHAR_CODE('lmtp'),        /* Returns one of SRLanguageObject Types listed below */
  258.     kSRRefCon                    = FOUR_CHAR_CODE('refc'),        /* 4 bytes of user storage */
  259.     kSROptional                    = FOUR_CHAR_CODE('optl'),        /* Boolean -- true if SRLanguageObject is optional    */
  260.     kSREnabled                    = FOUR_CHAR_CODE('enbl'),        /* Boolean -- true if SRLanguageObject enabled */
  261.     kSRRepeatable                = FOUR_CHAR_CODE('rptb'),        /* Boolean -- true if SRLanguageObject is repeatable */
  262.     kSRRejectable                = FOUR_CHAR_CODE('rjbl'),        /* Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord */
  263.                                                                 /*        object can be returned in place of SRLanguageObject with this property)    */
  264.     kSRRejectionLevel            = FOUR_CHAR_CODE('rjct')        /* SRRejectionLevel between 0 and 100 */
  265. };
  266.  
  267. /* LM Object Types -- returned as kSRLMObjType property of language model objects */
  268.  
  269. enum {
  270.     kSRLanguageModelType        = FOUR_CHAR_CODE('lmob'),        /* SRLanguageModel */
  271.     kSRPathType                    = FOUR_CHAR_CODE('path'),        /* SRPath */
  272.     kSRPhraseType                = FOUR_CHAR_CODE('phra'),        /* SRPhrase */
  273.     kSRWordType                    = FOUR_CHAR_CODE('word')        /* SRWord */
  274. };
  275.  
  276. /* a normal and reasonable rejection level */
  277.  
  278. enum {
  279.     kSRDefaultRejectionLevel    = 50
  280. };
  281.  
  282. /********************************************************************************/
  283. /*                        NOTES ON USING THE API                                    */
  284. /*                                                                                */
  285. /*        All operations (with the exception of SRGetRecognitionSystem) are        */
  286. /*        directed toward an object allocated or begot from New, Get and Read        */
  287. /*        type calls.                                                                */
  288. /*                                                                                */
  289. /*        There is a simple rule in dealing with allocation and disposal:            */
  290. /*                                                                                */
  291. /*        *    all toolbox allocations are obtained from a SRRecognitionSystem        */
  292. /*                                                                                */
  293. /*        *    if you obtain an object via New or Get, then you own a reference     */
  294. /*            to that object and it must be released via SRReleaseObject when        */
  295. /*            you no longer need it                                                */
  296. /*                                                                                */
  297. /*        *    when you receive a SRRecognitionResult object via AppleEvent or        */
  298. /*            callback, it has essentially been created on your behalf and so        */
  299. /*            you are responsible for releasing it as above                        */
  300. /*                                                                                */
  301. /*        *    when you close a SRRecognitionSystem, all remaining objects which        */
  302. /*            were allocated with it will be forcefully released and any            */
  303. /*            remaining references to those objects will be invalid.                */
  304. /*                                                                                */
  305. /*        This translates into a very simple guideline:                            */
  306. /*            If you allocate it or have it allocated for you, you must release    */
  307. /*            it.  If you are only peeking at it, then don't release it.            */
  308. /*                                                                                */
  309. /********************************************************************************/
  310. /* Opening and Closing of the SRRecognitionSystem */
  311. EXTERN_API( OSErr )
  312. SROpenRecognitionSystem            (SRRecognitionSystem *    system,
  313.                                  OSType                 systemID)                            THREEWORDINLINE(0x303C, 0x0400, 0xAA56);
  314.  
  315. EXTERN_API( OSErr )
  316. SRCloseRecognitionSystem        (SRRecognitionSystem     system)                                THREEWORDINLINE(0x303C, 0x0201, 0xAA56);
  317.  
  318. /* Accessing Properties of any Speech Object */
  319. EXTERN_API( OSErr )
  320. SRSetProperty                    (SRSpeechObject         srObject,
  321.                                  OSType                 selector,
  322.                                  const void *            property,
  323.                                  Size                     propertyLen)                        THREEWORDINLINE(0x303C, 0x0802, 0xAA56);
  324.  
  325. EXTERN_API( OSErr )
  326. SRGetProperty                    (SRSpeechObject         srObject,
  327.                                  OSType                 selector,
  328.                                  void *                    property,
  329.                                  Size *                    propertyLen)                        THREEWORDINLINE(0x303C, 0x0803, 0xAA56);
  330.  
  331. /* Any object obtained via New or Get type calls must be released */
  332. EXTERN_API( OSErr )
  333. SRReleaseObject                    (SRSpeechObject         srObject)                            THREEWORDINLINE(0x303C, 0x0204, 0xAA56);
  334.  
  335. EXTERN_API( OSErr )
  336. SRGetReference                    (SRSpeechObject         srObject,
  337.                                  SRSpeechObject *        newObjectRef)                        THREEWORDINLINE(0x303C, 0x0425, 0xAA56);
  338.  
  339. /* SRRecognizer Instance Functions */
  340. EXTERN_API( OSErr )
  341. SRNewRecognizer                    (SRRecognitionSystem     system,
  342.                                  SRRecognizer *            recognizer,
  343.                                  OSType                 sourceID)                            THREEWORDINLINE(0x303C, 0x060A, 0xAA56);
  344.  
  345. EXTERN_API( OSErr )
  346. SRStartListening                (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x020C, 0xAA56);
  347.  
  348. EXTERN_API( OSErr )
  349. SRStopListening                    (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x020D, 0xAA56);
  350.  
  351. EXTERN_API( OSErr )
  352. SRSetLanguageModel                (SRRecognizer             recognizer,
  353.                                  SRLanguageModel         languageModel)                        THREEWORDINLINE(0x303C, 0x040E, 0xAA56);
  354.  
  355. EXTERN_API( OSErr )
  356. SRGetLanguageModel                (SRRecognizer             recognizer,
  357.                                  SRLanguageModel *        languageModel)                        THREEWORDINLINE(0x303C, 0x040F, 0xAA56);
  358.  
  359. EXTERN_API( OSErr )
  360. SRContinueRecognition            (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0210, 0xAA56);
  361.  
  362. EXTERN_API( OSErr )
  363. SRCancelRecognition                (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0211, 0xAA56);
  364.  
  365. EXTERN_API( OSErr )
  366. SRIdle                            (void)                                                        THREEWORDINLINE(0x303C, 0x0028, 0xAA56);
  367.  
  368. /* Language Model Building and Manipulation Functions */
  369. EXTERN_API( OSErr )
  370. SRNewLanguageModel                (SRRecognitionSystem     system,
  371.                                  SRLanguageModel *        model,
  372.                                  const void *            name,
  373.                                  Size                     nameLength)                            THREEWORDINLINE(0x303C, 0x0812, 0xAA56);
  374.  
  375. EXTERN_API( OSErr )
  376. SRNewPath                        (SRRecognitionSystem     system,
  377.                                  SRPath *                path)                                THREEWORDINLINE(0x303C, 0x0413, 0xAA56);
  378.  
  379. EXTERN_API( OSErr )
  380. SRNewPhrase                        (SRRecognitionSystem     system,
  381.                                  SRPhrase *                phrase,
  382.                                  const void *            text,
  383.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x0814, 0xAA56);
  384.  
  385. EXTERN_API( OSErr )
  386. SRNewWord                        (SRRecognitionSystem     system,
  387.                                  SRWord *                word,
  388.                                  const void *            text,
  389.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x0815, 0xAA56);
  390.  
  391. /* Operations on any object of the SRLanguageObject family */
  392. EXTERN_API( OSErr )
  393. SRPutLanguageObjectIntoHandle    (SRLanguageObject         languageObject,
  394.                                  Handle                 lobjHandle)                            THREEWORDINLINE(0x303C, 0x0416, 0xAA56);
  395.  
  396. EXTERN_API( OSErr )
  397. SRPutLanguageObjectIntoDataFile    (SRLanguageObject         languageObject,
  398.                                  short                     fRefNum)                            THREEWORDINLINE(0x303C, 0x0328, 0xAA56);
  399.  
  400. EXTERN_API( OSErr )
  401. SRNewLanguageObjectFromHandle    (SRRecognitionSystem     system,
  402.                                  SRLanguageObject *        languageObject,
  403.                                  Handle                 lObjHandle)                            THREEWORDINLINE(0x303C, 0x0417, 0xAA56);
  404.  
  405. EXTERN_API( OSErr )
  406. SRNewLanguageObjectFromDataFile    (SRRecognitionSystem     system,
  407.                                  SRLanguageObject *        languageObject,
  408.                                  short                     fRefNum)                            THREEWORDINLINE(0x303C, 0x0427, 0xAA56);
  409.  
  410. EXTERN_API( OSErr )
  411. SREmptyLanguageObject            (SRLanguageObject         languageObject)                        THREEWORDINLINE(0x303C, 0x0218, 0xAA56);
  412.  
  413. EXTERN_API( OSErr )
  414. SRChangeLanguageObject            (SRLanguageObject         languageObject,
  415.                                  const void *            text,
  416.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x0619, 0xAA56);
  417.  
  418. EXTERN_API( OSErr )
  419. SRAddLanguageObject                (SRLanguageObject         base,
  420.                                  SRLanguageObject         addon)                                THREEWORDINLINE(0x303C, 0x041A, 0xAA56);
  421.  
  422. EXTERN_API( OSErr )
  423. SRAddText                        (SRLanguageObject         base,
  424.                                  const void *            text,
  425.                                  Size                     textLength,
  426.                                  long                     refCon)                                THREEWORDINLINE(0x303C, 0x081B, 0xAA56);
  427.  
  428. EXTERN_API( OSErr )
  429. SRRemoveLanguageObject            (SRLanguageObject         base,
  430.                                  SRLanguageObject         toRemove)                            THREEWORDINLINE(0x303C, 0x041C, 0xAA56);
  431.  
  432. /* Traversing SRRecognitionResults or SRLanguageObjects */
  433. EXTERN_API( OSErr )
  434. SRCountItems                    (SRSpeechObject         container,
  435.                                  long *                    count)                                THREEWORDINLINE(0x303C, 0x0405, 0xAA56);
  436.  
  437. EXTERN_API( OSErr )
  438. SRGetIndexedItem                (SRSpeechObject         container,
  439.                                  SRSpeechObject *        item,
  440.                                  long                     index)                                THREEWORDINLINE(0x303C, 0x0606, 0xAA56);
  441.  
  442. EXTERN_API( OSErr )
  443. SRSetIndexedItem                (SRSpeechObject         container,
  444.                                  SRSpeechObject         item,
  445.                                  long                     index)                                THREEWORDINLINE(0x303C, 0x0607, 0xAA56);
  446.  
  447. EXTERN_API( OSErr )
  448. SRRemoveIndexedItem                (SRSpeechObject         container,
  449.                                  long                     index)                                THREEWORDINLINE(0x303C, 0x0408, 0xAA56);
  450.  
  451. /* Utilizing the System Feedback Window */
  452. EXTERN_API( OSErr )
  453. SRDrawText                        (SRRecognizer             recognizer,
  454.                                  const void *            dispText,
  455.                                  Size                     dispLength)                            THREEWORDINLINE(0x303C, 0x0621, 0xAA56);
  456.  
  457. EXTERN_API( OSErr )
  458. SRDrawRecognizedText            (SRRecognizer             recognizer,
  459.                                  const void *            dispText,
  460.                                  Size                     dispLength)                            THREEWORDINLINE(0x303C, 0x0622, 0xAA56);
  461.  
  462. EXTERN_API( OSErr )
  463. SRSpeakText                        (SRRecognizer             recognizer,
  464.                                  const void *            speakText,
  465.                                  Size                     speakLength)                        THREEWORDINLINE(0x303C, 0x0620, 0xAA56);
  466.  
  467. EXTERN_API( OSErr )
  468. SRSpeakAndDrawText                (SRRecognizer             recognizer,
  469.                                  const void *            text,
  470.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x061F, 0xAA56);
  471.  
  472. EXTERN_API( OSErr )
  473. SRStopSpeech                    (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0223, 0xAA56);
  474.  
  475. EXTERN_API( Boolean )
  476. SRSpeechBusy                    (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0224, 0xAA56);
  477.  
  478. EXTERN_API( OSErr )
  479. SRProcessBegin                    (SRRecognizer             recognizer,
  480.                                  Boolean                 failed)                                THREEWORDINLINE(0x303C, 0x031D, 0xAA56);
  481.  
  482. EXTERN_API( OSErr )
  483. SRProcessEnd                    (SRRecognizer             recognizer,
  484.                                  Boolean                 failed)                                THREEWORDINLINE(0x303C, 0x031E, 0xAA56);
  485.  
  486.  
  487.  
  488.  
  489. #if PRAGMA_STRUCT_ALIGN
  490.     #pragma options align=reset
  491. #elif PRAGMA_STRUCT_PACKPUSH
  492.     #pragma pack(pop)
  493. #elif PRAGMA_STRUCT_PACK
  494.     #pragma pack()
  495. #endif
  496.  
  497. #ifdef PRAGMA_IMPORT_OFF
  498. #pragma import off
  499. #elif PRAGMA_IMPORT
  500. #pragma import reset
  501. #endif
  502.  
  503. #ifdef __cplusplus
  504. }
  505. #endif
  506.  
  507. #endif /* __SPEECHRECOGNITION__ */
  508.  
  509.